// getall
// const href = 'https://www.so.com/s?id=1000&id=200&name=lisi'
const href = 'https://www.so.com/s?id=1000&name=lisi'

// js提供一个URL类,它就可以直接解析url
const url = new URL(href)

console.log(url.pathname);
// console.log(url.searchParams.get('id'));
// getAll获取指定名称的所有的值
// console.log(url.searchParams.getAll('id'));
// console.log(url.searchParams.get('name'));

/* for(let item of url.searchParams.entries()){
  console.log(item);
} */

for(let [key,value] of url.searchParams.entries()){
  console.log(key,value);
}




